﻿<%@ WebHandler Language="C#" Class="SIPO.Web.AjaxHandler.Loaddata.getregistrationemisiontypeispubliccompany" %>

using System;
using System.Web;
using System.Collections.Generic;
using System.Linq;
using System.Configuration;
using SIPO.Library.DataAccess.Administration.Catalog;
using SIPO.Library.DomainObject.Administration.Catalog;
using SIPO.Library.Enum;
using SIPO.Web.Support;
using Newtonsoft.Json.Linq;

namespace SIPO.Web.AjaxHandler.Loaddata
{
    public class getregistrationemisiontypeispubliccompany : SIPO.Web.BaseHandler
    {
        recRegistrationEmisionTypeRepo recRegistrationEmisionTypeDal = new recRegistrationEmisionTypeRepo(ConfigurationManager.ConnectionStrings["SIPOConn"].ConnectionString);
        public override void ProcessRequest(HttpContext context)
        {
            base.ProcessRequest(context);

            short isPublicCompany = short.Parse(context.Request.Params["isPublicCompany"]);

            List<recRegistrationEmisionType> registrationEmisionTypes = recRegistrationEmisionTypeDal.GetList(isPublicCompany);
            var result = registrationEmisionTypes;

            context.Response.Write(Newtonsoft.Json.JsonConvert.SerializeObject(result));
        }

        public override bool IsReusable
        {
            get
            {
                return false;
            }
        }
    }
}